package com.uphone.kingmall.adapter;

import android.widget.ImageView;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.china.zhuoyue.R;
import com.uphone.kingmall.bean.SettleCartBean;
import com.uphone.kingmall.utils.GlideUtils;

/**
 * <pre>
 *     author : radish
 *     e-mail : 15703379121@163.com
 *     time   : 2019/3/20
 *     desc   :
 * </pre>
 */
public class SettleGoodAdapter extends BaseQuickAdapter<SettleCartBean.ShopGoodsBean.GoodsBean, BaseViewHolder> {

    public SettleGoodAdapter() {
        super(R.layout.kingmall_item_order_goods);
    }

    @Override
    protected void convert(BaseViewHolder helper, SettleCartBean.ShopGoodsBean.GoodsBean item) {
        ImageView image = helper.getView(R.id.iv_goods_image);
        GlideUtils.getInstance().loadCornerImage(mContext, item.getGoodsMainImg(), SizeUtils.dp2px(2), image);
        helper.setText(R.id.tv_goods_name, item.getGoodsName() + "");
        helper.setText(R.id.tv_goods_specification, "规格：" + item.getGoodsSpec() + "");
        helper.setText(R.id.tv_goods_price, item.getGoodsPerFee() + "");
        helper.setText(R.id.tv_goods_number, "X" + item.getGoodsNum() + "");
    }
}
